package org.linlinjava.litemall.wxserver.web;

import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallMechanismVo;
import org.linlinjava.litemall.db.service.LitemallMechanismService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/wxs/map")
public class WxMapController {
    @Autowired
    private LitemallMechanismService mechanismService;


    @GetMapping("/getMechanism")
    public Object getMechanism(String longitude, String latitude) {
        List<LitemallMechanismVo> list = mechanismService.searchMechanism(longitude, latitude, "");

        Map<String, Object> data = new HashMap();
        data.put("list", list);
        return ResponseUtil.ok(data);

    }

}
